"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const UserModel_1 = require("../model/UserModel");
const MySqlUtil_1 = require("../../engine/utils/MySqlUtil");
const Logger_1 = require("../../engine/utils/Logger");
class UserDao {
    static insertUser(user) {
        // let dd:string = " INSERT INTO users values(null, 100002, "test2", "nickname2");"
    }
    static queryUserById(userid) {
        MySqlUtil_1.MySqlUtil.executeSql(this.Sql_queryUserById + userid, (isOk, result) => {
            if (isOk) {
                Logger_1.Logger.log("queryUserById===", result);
            }
        });
    }
    static queryAllUsers() {
        MySqlUtil_1.MySqlUtil.executeSql(this.Sql_queryAllUser, (isOk, result) => {
            if (isOk) {
                for (let i = 0; i < result.length; i++) {
                    let model = UserModel_1.UserModel.createModel(result[i]);
                    UserModel_1.UserModel.userList[i] = model;
                }
                Logger_1.Logger.log("queryAllUsers===", UserModel_1.UserModel.userList);
            }
        });
    }
}
exports.UserDao = UserDao;
UserDao.Sql_queryAllUser = "SELECT * FROM users;";
UserDao.Sql_queryUserById = "select * from users where userid=";
